<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/img/favicon.ico"/>
<link rel="icon" href="/img/favicon.ico" type="image/x-icon" />
<title>七號倉庫管理系統</title>
  
<style>
html, body {
	margin: 0;			/* Remove body margin/padding */
	padding: 0;
	overflow: hidden;	/* Remove scroll bars on browser window */	
    font-size: 75%;
}
/*Splitter style */


#LeftPane {
	/* optional, initial splitbar position */
	overflow: auto;
}
/*
 * Right-side element of the splitter.
*/

#RightPane {
	padding: 2px;
	overflow: auto;
}
.ui-tabs-nav li {position: relative;}
.ui-tabs-selected a span {padding-right: 10px;}
.ui-tabs-close {display: none;position: absolute;top: 3px;right: 0px;z-index: 800;width: 16px;height: 14px;font-size: 10px; font-style: normal;cursor: pointer;}
.ui-tabs-selected .ui-tabs-close {display: block;}
.ui-layout-west .ui-jqgrid tr.jqgrow td { border-bottom: 0px none;}
.ui-datepicker {z-index:1200;}
</style>

<link rel="shortcut icon" href="favicon.ico"/>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" media="screen" href="ui.jqgrid.css" />
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/redmond/jquery-ui.css" rel="stylesheet" />	
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js" type="text/javascript"></script>
<script src="js/jquery.layout.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-zh_TW.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<script src="js/jquery.contextmenu.js" type="text/javascript"></script>
<script type="text/javascript">
//var gridimgpath = 'themes/basic/images';
var gridimgpath = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/basic/images';
jQuery(document).ready(function(){
    //$('#switcher').themeswitcher();
  $.getJSON('/userinfo?callback=?',
    function(user){
      if (!user.is_login) {
        window.location = '/';
      }else{
        if (user.is_admin) {
          $('#userinfo').append("<h1> 偉大的管理員 '" + user.nickname + "' 您好</h1>");
        }else {
          $('#userinfo').append("<h1> 你好 " + user.nickname + "</h1>");
        }
      }
    });

	$('body').layout({
		resizerClass: 'ui-state-default',
        west__onresize: function (pane, $Pane) {
            jQuery("#west-grid").setGridWidth($Pane.innerWidth()-2);
		}
	});
	$.jgrid.defaults = $.extend($.jgrid.defaults,{loadui:"enable"});
	var maintab =jQuery('#tabs','#RightPane').tabs({
        add: function(e, ui) {
            // append close thingy
            $(ui.tab).parents('li:first')
                .append('<span class="ui-tabs-close ui-icon ui-icon-close" title="Close Tab"></span>')
                .find('span.ui-tabs-close')
                .click(function() {
                    maintab.tabs('remove', $('li', maintab).index($(this).parents('li:first')[0]));
                });
            // select just added tab
            maintab.tabs('select', '#' + ui.panel.id);
        }
    });
    jQuery("#west-grid").jqGrid({
        url: "tree.xml",
        datatype: "xml",
        height: "auto",
        pager: false,
        loadui: "disable",
        colNames: ["id","項目","url"],
        colModel: [
            {name: "id",width:1,hidden:true, key:true},
            {name: "menu", width:150, resizable: false, sortable:false},
            {name: "url",width:1,hidden:true}
        ],
        treeGrid: true,
		caption: "管理功能列表",
        ExpandColumn: "menu",
        autowidth: true,
        //width: 180,
        rowNum: 200,
        ExpandColClick: true,
        treeIcons: {leaf:'ui-icon-document-b'},
        onSelectRow: function(rowid) {
            var treedata = $("#west-grid").getRowData(rowid);
            if(treedata.isLeaf=="true") {
                //treedata.url
                var st = "#t"+treedata.id;
				if($(st).html() != null ) {
					maintab.tabs('select',st);
				} else {
					maintab.tabs('add',st, treedata.menu);
					$(st,"#tabs").load(treedata.url);
				}
            }
        }
    });
	
// end splitter

});
</script>
</head>
<body>
  	<div id="LeftPane" class="ui-layout-west ui-widget ui-widget-content">
		<table id="west-grid"></table>
	</div> <!-- #LeftPane -->
	<div id="RightPane" class="ui-layout-center ui-helper-reset ui-widget-content" ><!-- Tabs pane -->
    <div id="switcher"></div>
		<div id="tabs" class="jqgtabs">
			<ul>
				<li><a href="#tabs-1">七號倉庫管理系統</a></li>
			</ul>
      <div id="tabs-1" style="font-size:12px;"> 
        <div id='userinfo'></div>
        <h2>新消息</h2>
        <div>
          中文搜尋問題已解決，支援"begin with"的字串搜尋
        </div>
        <div>
          Product 的tag, spec(標籤,規格)改用StringList, 搜尋equal時只要符合任一字串即可<br/>
          例如 tag=人身部品,男車衣，不論是equal人身部品或是equal 男車衣，都可找出符合資料
        </div>
        <div>
          <h2>正在進行實作清單</h2>
          <p>基本管理</p>
          <ul>
            <li><a>商品瀏覽</a></li>
            <li><a>供應商管理</a></li>
            <li><a>供應商-商品管理</a></li>
          </ul>
          <p>進出貨管理</p>
          <ul>
            <li><a>批次進出貨</a></li>
          </ul>
        </div>
        <p> 等待實作功能清單<p>
        <ul>
          <li><a>商品管理</a></li>
          <li><a>庫存管理</a></li>
          <li><a>等...</a></li>
        </ul>
        <p>請耐心等待實作...</p>
        <p><a href='https://docs.google.com/a/bike7now.co.cc/View?id=dcf7v9mp_66d5hk55gp'>管理系統規劃書在這裡</a></p>
			</div>
		</div>
	</div> <!-- #RightPane -->
</body>
</html>
